package com.feng.cloud.system.dto;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName Tree
 * @Description TODO
 * @Author Better Feng
 * @Date 2019/12/21 22:38
 * @Version 1.0
 **/
@Getter
@Setter
@ToString
@Accessors(chain = true)
public class Tree<T> {

    private String id;

    private String label;

    private List<Tree<T>> children;

    private String parentId;

    private boolean hasParent = false;

    private boolean hasChildren = false;

    public void initChildren(){
        this.children = new ArrayList<>();
    }
}
